import dayjs from 'dayjs'

/**
 * author: 何其沆(pooky)
 * desc: 所有列表行数据
 * date: 2021-11-12
 */
export default {
  // Pool - Account Pool
  accountPool: [
    {
      name: 'Tags',
      dataIndex: 'tags',
      key: 'tags',
      width: '220px'
    },
    {
      title: 'Organization',
      dataIndex: 'clientOrganizationName',
      key: 'clientOrganizationName'
    },
    {
      title: 'Client Name',
      dataIndex: 'fullName',
      key: 'fullName'
    },
    {
      title: 'Abbreviation',
      dataIndex: 'shortName',
      key: 'shortName'
    },
    {
      title: 'URL',
      dataIndex: 'url',
      key: 'url'
    },
    {
      title: 'Tier',
      dataIndex: 'clientTierName',
      key: 'clientTierName',
      width: '80px'
    },
    {
      title: 'Status',
      dataIndex: 'statusName',
      key: 'statusName'
    },
    {
      title: 'Owner',
      dataIndex: 'displayName',
      key: 'displayName'
    },
    {
      title: 'Expiry Date',
      dataIndex: 'expiryDateAdd',
      key: 'expiryDateAdd',
      width: '120px'
    },
    {
      title: 'Create on',
      dataIndex: 'createOn',
      key: 'createOn',
      width: '120px',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    }
  ],
  // Existing Clients
  existingClients: [
    {
      name: 'Tags',
      dataIndex: 'tags',
      key: 'tags',
      width: '180px'
    },
    {
      title: 'Organization',
      dataIndex: 'clientOrganizationName',
      key: 'clientOrganizationName'
    },
    {
      title: 'Client Name',
      dataIndex: 'fullName',
      key: 'fullName',
      sorter: true
    },
    {
      title: 'Abbreviation',
      dataIndex: 'shortName',
      key: 'shortName',
      sorter: true
    },
    {
      title: 'Country/Region',
      dataIndex: 'countryID',
      key: 'countryID'
    },
    {
      title: 'Client Industry',
      dataIndex: 'saleBUName',
      key: 'saleBUName'
    },
    {
      title: 'Turn Positive On',
      dataIndex: 'turnPositiveOn',
      key: 'turnPositiveOn',
      sorter: true,
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Owner',
      dataIndex: 'displayName',
      key: 'displayName'
    }
  ],
  // CRM Operate Record
  crmOperateRecord: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Operate Type',
      dataIndex: 'operaterTypeName',
      key: 'operaterTypeName'
    },
    {
      title: 'Old Owner',
      dataIndex: 'oldOwnerName',
      key: 'oldOwnerName'
    },
    {
      title: 'Old Status',
      dataIndex: 'oldStatusName',
      key: 'oldStatusName'
    },
    {
      title: 'New Owner',
      dataIndex: 'newOwnerName',
      key: 'newOwnerName'
    },
    {
      title: 'New Status',
      dataIndex: 'newStatusName',
      key: 'newStatusName'
    },
    {
      title: 'Operator',
      dataIndex: 'modifyByName',
      key: 'modifyByName'
    },
    {
      title: 'Operate On',
      dataIndex: 'modifyOn',
      key: 'modifyOn',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Reason',
      dataIndex: 'reason',
      key: 'reason'
    }
  ],
  // Organization
  organization: [
    {
      title: 'Organization',
      dataIndex: 'clientOrganizationName',
      key: 'clientOrganizationName',
      sorter: true
    },
    {
      title: 'Created By',
      dataIndex: 'createByName',
      key: 'createByName'
    },
    {
      title: 'Created On',
      dataIndex: 'createOn',
      key: 'createOn',
      width: '180px',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Client',
      dataIndex: 'client',
      key: 'client'
    },
    {
      title: 'Operate',
      dataIndex: 'operate',
      key: 'operate',
      width: '150px'
    }
  ],
  // Through Customer
  throughCustomer: [
    {
      title: 'Organization',
      dataIndex: 'organizationName',
      key: 'organizationName',
      sorter: true
    },
    {
      title: 'Client Name',
      dataIndex: 'fullName',
      key: 'fullName'
    },
    {
      title: 'URL',
      dataIndex: 'url',
      key: 'url'
    },
    {
      title: 'Tier',
      dataIndex: 'tierName',
      key: 'tierName'
    },
    {
      title: 'Status',
      dataIndex: 'statusName',
      key: 'statusName'
    },
    {
      title: 'Owner',
      dataIndex: 'ownerName',
      key: 'ownerName'
    },
    {
      title: 'Create On',
      dataIndex: 'createOn',
      key: 'createOn',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Operate',
      dataIndex: 'operate',
      key: 'operate'
    }
  ],
  // Weekly Task
  weeklyTask: [
    {
      title: 'Name',
      dataIndex: 'displayName',
      key: 'displayName'
    },
    {
      title: 'Touched Clients',
      dataIndex: 'touchedClients',
      key: 'touchedClients'
    },
    {
      title: 'Responsive Clients',
      dataIndex: 'responsiveClients',
      key: 'responsiveClients'
    },
    {
      title: 'Positive Clients',
      dataIndex: 'positiveClients',
      key: 'positiveClients'
    },
    {
      title: 'Phase 3',
      dataIndex: 'pThree',
      key: 'pThree'
    },
    {
      title: 'Phase 2',
      dataIndex: 'pTwo',
      key: 'pTwo'
    },
    {
      title: 'Phase 1',
      dataIndex: 'pOne',
      key: 'pOne'
    },
    {
      title: 'Close Clients',
      dataIndex: 'closeClients',
      key: 'closeClients'
    },
    {
      name: 'Operate',
      dataIndex: 'operate',
      key: 'operate'
    }
  ],
  // Product Line
  productLine: [
    {
      title: 'Product Line Name',
      dataIndex: 'productLineName',
      key: 'productLineName',
      width: '15vw'
    },
    {
      title: 'Created By',
      dataIndex: 'displayName',
      key: 'displayName',
      width: '240px'
    },
    {
      title: 'Created On',
      dataIndex: 'createOn',
      key: 'createOn',
      width: '180px',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Note',
      dataIndex: 'description',
      key: 'description'
    },
    {
      title: 'Operate',
      dataIndex: 'operate',
      key: 'operate',
      width: '180px'
    }
  ],
  // Log Record
  logRecord: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Operate Type',
      dataIndex: 'operaterTypeName',
      key: 'operaterTypeName'
    },
    {
      title: 'Old Owner',
      dataIndex: 'oldOwnerName',
      key: 'oldOwnerName'
    },
    {
      title: 'Old Status',
      dataIndex: 'oldStatusName',
      key: 'oldStatusName'
    },
    {
      title: 'New Owner',
      dataIndex: 'newOwnerName',
      key: 'newOwnerName'
    },
    {
      title: 'Operator',
      dataIndex: 'modifyByName',
      key: 'modifyByName'
    },
    {
      title: 'Operate On',
      dataIndex: 'modifyOn',
      key: 'modifyOn',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Reason',
      dataIndex: 'reason',
      key: 'reason'
    }
  ],
  // Others - Performance
  performance: [
    {
      title: 'Batch Number',
      dataIndex: 'paymentNum',
      key: 'paymentNum'
    },
    {
      title: 'Status',
      dataIndex: 'stationStateText',
      key: 'stationStateText'
    },
    {
      title: 'Commission End Date',
      dataIndex: 'paymentDate',
      key: 'paymentDate',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Commission',
      dataIndex: 'commission',
      key: 'commission',
      align: 'right'
    }
  ],
  // Others - Performance - Received Payment
  receivedPayment: [
    {
      title: 'Invoice Number',
      dataIndex: 'invoiceNum',
      key: 'invoiceNum'
    },
    {
      title: 'Total Amount',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName'
    },
    {
      title: 'Received Date',
      dataIndex: 'paytime',
      key: 'paytime',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Client Name',
      dataIndex: 'clientShortName',
      key: 'clientShortName'
    },
    {
      title: 'Commission Factor',
      dataIndex: 'priceCoefficient',
      key: 'priceCoefficient',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Initial Date',
      dataIndex: 'beginCooperate',
      key: 'beginCooperate',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Takeover Date',
      dataIndex: 'firstProjectDate',
      key: 'firstProjectDate',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Year Factor',
      dataIndex: 'yearPercent',
      key: 'yearPercent',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Commission Percentage',
      dataIndex: 'perPersonal',
      key: 'perPersonal',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) + '%' : '')
    },
    {
      title: 'System',
      dataIndex: 'systemType',
      key: 'systemType',
      customRender: ({ text }) => {
        if (text === null) {
          return 'New'
        } else if (text === 0) {
          return 'Early'
        } else {
          return 'New'
        }
      }
    }
  ],
  // Others - Performance - Received Payment2
  receivedPayment2: [
    {
      title: 'Invoice Number',
      dataIndex: 'invoiceNum',
      key: 'invoiceNum'
    },
    {
      title: 'Total Amount',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName'
    },
    {
      title: 'Received Date',
      dataIndex: 'paytime',
      key: 'paytime',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Client Name',
      dataIndex: 'clientShortName',
      key: 'clientShortName'
    },
    {
      title: 'Commission Factor',
      dataIndex: 'priceCoefficient',
      key: 'priceCoefficient',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Initial Date',
      dataIndex: 'beginCooperate',
      key: 'beginCooperate',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Takeover Date',
      dataIndex: 'firstProjectDate',
      key: 'firstProjectDate',
      customRender: ({ text }) => (text ? dayjs(text).format('MM/DD/YYYY') : '--')
    },
    {
      title: 'Year Factor',
      dataIndex: 'yearPercent',
      key: 'yearPercent',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) : '')
    },
    {
      title: 'Commission Percentage',
      dataIndex: 'perPersonal',
      key: 'perPersonal',
      align: 'right',
      customRender: ({ text }) => (text ? text.toFixed(2) + '%' : '')
    },
    {
      title: 'System',
      dataIndex: 'systemType',
      key: 'systemType',
      customRender: ({ text }) => {
        if (text === null) {
          return 'New'
        } else if (text === 0) {
          return 'Early'
        } else {
          return 'New'
        }
      }
    },
    {
      title: 'State',
      dataIndex: 'isSettling',
      key: 'isSettling',
      customRender: ({ text }) => {
        if (text) {
          return 'Settling'
        } else {
          return 'Unsettled'
        }
      }
    }
  ],
  // Others - Sales Division
  salesDivision: [
    {
      title: 'Batch Number',
      dataIndex: 'paymentNum',
      key: 'paymentNum'
    },
    {
      title: 'Commission End Date',
      dataIndex: 'paymentDate',
      key: 'paymentDate',
      customRender: ({ text }) => (text ? dayjs(text).format('YYYY-MM-DD') : '--')
    },
    {
      title: 'Commission Status',
      dataIndex: 'statusName',
      key: 'statusName'
    }
  ],
  // Others - Sales Division - Commission
  commission: [
    {
      title: 'Batch Number',
      dataIndex: 'paymentNum',
      key: 'paymentNum'
    },
    {
      title: 'Sales Personnel',
      dataIndex: 'displayName',
      key: 'displayName'
    },
    {
      title: 'Branch',
      dataIndex: 'branchName',
      key: 'branchName'
    },
    {
      title: 'Status',
      dataIndex: 'stationStateText',
      key: 'stationStateText'
    },
    {
      title: 'Commission',
      dataIndex: 'commission',
      key: 'commission',
      align: 'right'
    }
  ],
  // Others - Statistics - Invoice Number - Client
  invoiceNumberClient: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Invoice Amount (In Currency)',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName'
    },
    {
      title: 'Exchange Rate (RMB)',
      dataIndex: 'rate',
      key: 'rate',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Invoice Amount (RMB)',
      dataIndex: 'invoiceAmountRMB',
      key: 'invoiceAmountRMB',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    }
  ],
  // Others - Statistics - Invoice Number - Invoices
  invoiceNumberInvoices: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'ClientShortName',
      sorter: true
    },
    {
      title: 'Invoice Number',
      dataIndex: 'invoiceNum',
      key: 'invoiceNum',
      sorter: true
    },
    {
      title: 'Invoice Amount',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName',
      sorter: true
    },
    {
      title: 'Invoice Status',
      dataIndex: 'invoiceStatusName',
      key: 'OrderInvoiceStatus',
      sorter: true
    },
    {
      title: 'Commission',
      dataIndex: 'salesRule',
      key: 'salesRule',
      customRender: ({ text }) => (text ? text * 100 + '%' : '0%')
    },
    {
      title: 'Branch',
      dataIndex: 'branchName',
      key: 'branchName',
      sorter: true
    },
    {
      title: 'Sales Personnel',
      dataIndex: 'displayName',
      key: 'EmpName',
      sorter: true
    }
  ],
  // Others - Statistics - Payment Received - Client
  paymentReceivedClient: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Invoice Amount (In Currency)',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName'
    },
    {
      title: 'Exchange Rate (RMB)',
      dataIndex: 'rate',
      key: 'rate',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Invoice Amount (RMB)',
      dataIndex: 'invoiceAmountRMB',
      key: 'invoiceAmountRMB',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    }
  ],
  // Others - Statistics - Payment Received - Invoices
  paymentReceivedInvoices: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'ClientShortName',
      sorter: true
    },
    {
      title: 'Invoice Number',
      dataIndex: 'invoiceNum',
      key: 'invoiceNum',
      sorter: true
    },
    {
      title: 'Invoice Amount',
      dataIndex: 'invoiceAmount',
      key: 'invoiceAmount',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName',
      sorter: true
    },
    {
      title: 'Invoice Status',
      dataIndex: 'invoiceStatusName',
      key: 'OrderInvoiceStatus',
      sorter: true
    },
    {
      title: 'Commission',
      dataIndex: 'salesRule',
      key: 'salesRule',
      customRender: ({ text }) => (text ? text * 100 + '%' : '0%')
    },
    {
      title: 'Branch',
      dataIndex: 'branchName',
      key: 'branchName',
      sorter: true
    },
    {
      title: 'Sales Personnel',
      dataIndex: 'displayName',
      key: 'EmpName',
      sorter: true
    }
  ],
  // Others - Statistics - Project Details
  projectDetails: [
    {
      title: 'Account Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Project Name',
      dataIndex: 'projectName',
      key: 'projectName'
    },
    {
      title: 'Project Number',
      dataIndex: 'projectNumber',
      key: 'projectNumber'
    },
    {
      title: 'Project Process',
      dataIndex: 'projectProcess',
      key: 'projectProcess'
    },
    {
      title: 'Project Total Amount',
      dataIndex: 'projectAmount',
      key: 'projectAmount',
      align: 'right'
    },
    {
      title: 'Amount Invoiced',
      dataIndex: 'amountInvoiced',
      key: 'amountInvoiced',
      align: 'right'
    },
    {
      title: 'Amount Received',
      dataIndex: 'amountReceived',
      key: 'amountReceived',
      align: 'right'
    }
  ],
  // Others - Statistics - Purchase Order - Client
  purchaseOrderClient: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Taken Amount (In Currency)',
      dataIndex: 'poAmount',
      key: 'poAmount',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName'
    },
    {
      title: 'Exchange Rate (RMB)',
      dataIndex: 'rate',
      key: 'rate',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Taken Amount (RMB)',
      dataIndex: 'poAmountRMB',
      key: 'poAmountRMB',
      align: 'right',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    }
  ],
  // Others - Statistics - Purchase Order - PO
  purchaseOrderPo: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'ClientShortName',
      sorter: true
    },
    {
      title: 'PO Number',
      dataIndex: 'poNumber',
      key: 'poNumber',
      sorter: true
    },
    {
      title: 'PO Amount',
      dataIndex: 'poAmount',
      key: 'poAmount',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Taken Amount',
      dataIndex: 'employPrice',
      key: 'employPrice',
      customRender: ({ text }) => (text ? Number(text).toFixed(2) : '')
    },
    {
      title: 'Currency',
      dataIndex: 'currencyName',
      key: 'currencyName',
      sorter: true
    },
    {
      title: 'Commission',
      dataIndex: 'salesRule',
      key: 'salesRule',
      customRender: ({ text }) => (text ? text * 100 + '%' : '0%')
    },
    {
      title: 'Branch',
      dataIndex: 'branchName',
      key: 'branchName',
      sorter: true
    },
    {
      title: 'Sales Personnel',
      dataIndex: 'desplayName',
      key: 'EmpName',
      sorter: true
    }
  ],
  // -------------------------
  // Contract
  contract: [
    {
      title: 'Contract Number',
      dataIndex: 'contractNumber',
      key: 'contractNumber'
    },
    {
      title: 'Contract Name',
      dataIndex: 'contractName',
      key: 'contractName'
    },
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Type',
      dataIndex: 'type',
      key: 'type'
    },
    {
      title: 'Start Date',
      dataIndex: 'startDate',
      key: 'startDate'
    },
    {
      title: 'End Date',
      dataIndex: 'endDate',
      key: 'endDate'
    },
    {
      title: 'Status',
      dataIndex: 'status',
      key: 'status'
    },
    {
      title: 'Attachment',
      key: 'attachment'
    }
  ],
  // Others - Commission Percentage
  commissionPercentage: [
    {
      title: 'Client Name',
      dataIndex: 'clientName',
      key: 'clientName'
    },
    {
      title: 'Commission Factor',
      dataIndex: 'commissionFactor',
      key: 'commissionFactor'
    },
    {
      title: 'Initial Date',
      dataIndex: 'initialDate',
      key: 'initialDate'
    },
    {
      title: 'Takeover Date',
      dataIndex: 'takeoverDate',
      key: 'takeoverDate'
    },
    {
      title: 'Commission Percentage',
      dataIndex: 'commissionPercentage',
      key: 'commissionPercentage'
    }
  ]
}
